\documentclass[UTF8]{ctexart}
% matrix, iint等需要引入amsmath包
\usepackage{amsmath}
% 使用 \color \pagecolor
\usepackage{color}
\title{数学表达式}
\author{fosonmeng}
\begin{document}
	\maketitle
	\tableofcontents
	
	\section{上标下标和积分}
	\begin{tabular}{lc}
		\hline
		Syntax & Results\\
		\hline
		\verb|\sqrt[3]{9}| & $\sqrt[3]{9}$\\
		\verb|a_{i,j}| & $a_{i,j}$\\
		\verb|{}_1^2\!X_3^4| & ${}_1^2\!X_3^4$\\
		\verb|x^\prime| & $x^\prime$\\
		\verb|\dot{x}| & $\dot{x}$\\
		\verb|\ddot{y}| & $\ddot{y}$\\
		\verb|\vec{c}| & $\vec{c}$\\
		\verb|\overleftarrow{a b}| & $\overleftarrow{a b}$\\
		\verb|\widehat{e f g}| & $\widehat{e f g}$\\
		\verb|\overset{\frown}{AB}| & \\
		\verb|\sum_{k=1}^N k^2| & $\sum_{k=1}^N k^2$\\
		\verb|\begin{matrix} \prod_{i=1}^N x_i \end{matrix}| & $\prod_{i=1}^N x_i$ \\
		\verb|\lim_{n \to \infty}x_n| & $\lim_{n \to \infty}x_n$\\
		\verb|\int_{-N}^{N} e^x\, dx| & $\int_{-N}^{N} e^x\, dx$\\
		\verb|\iint_{D}^{W} \, dx\,dy| & $\iint_{D}^{W} \, dx\,dy$\\
		\verb|\iiint_{E}^{V} \, dx\,dy\,dz| & $\iiint_{E}^{V} \, dx\,dy\,dz$\\
		\verb|\iiiint_{F}^{U} \, dx\,dy\,dz\,dt| & $\iiiint_{F}^{U} \, dx\,dy\,dz\,dt$\\
		\verb|\oint_{C} x^3\, dx + 4y^2\, dy| & $\oint_{C} x^3\, dx + 4y^2\, dy$\\
		\verb|\bigcap_1^{n} p| & $\bigcap_1^{n} p$\\
		\verb|\bigcup_1^{k} p| & $\bigcup_1^{k} p$\\
		\hline
	\end{tabular}

	\section{分数、矩阵和多行列式}
	\begin{tabular}{lc}
		\hline
		Syntax                                               &                     Results                     \\ \hline
		\verb|\frac{2}{4}=0.5|                               &                $\frac{2}{4}=0.5$                \\
		\verb|	\tfrac{2}{4} = 0.5|                           &              $	\tfrac{2}{4} = 0.5$              \\
		\verb|\cfrac{2}{c + \cfrac{2}{d + \cfrac{2}{4}}} =a| & $\cfrac{2}{c + \cfrac{2}{d + \cfrac{2}{4}}} =a$ \\
		\verb|\dbinom{n}{r}=\binom{n}{n-r}=C^n_r=C^n_{n-r}|  & $\dbinom{n}{r}=\binom{n}{n-r}=C^n_r=C^n_{n-r}$  \\
		\verb|\tbinom{n}{r}=\tbinom{n}{n-r}=C^n_r=C^n_{n-r}|  & $\tbinom{n}{r}=\tbinom{n}{n-r}=C^n_r=C^n_{n-r}$  \\ \hline
	\end{tabular}

	\subsection{矩阵}
	\begin{enumerate}
		\item 
			\begin{verbatim}
				$\begin{matrix}
					x & y \\
					z & v
				\end{matrix}$
			\end{verbatim}
			
			$\begin{matrix}
				x & y \\
				z & v
			\end{matrix}$
		\item 
			\begin{verbatim}
				\begin{vmatrix}
				x & y \\
				z & v
				\end{vmatrix}
			\end{verbatim}
			
			$\begin{vmatrix}
			x & y \\
			z & v
			\end{vmatrix}$
		\item 
			\begin{verbatim}
				\begin{Vmatrix}
				x & y \\
				z & v
				\end{Vmatrix}
			\end{verbatim}
			
			$\begin{Vmatrix}
			x & y \\
			z & v
			\end{Vmatrix}$
		\item 
			\begin{verbatim}
				\begin{bmatrix}
				0      & \cdots & 0      \\
				\vdots & \ddots & \vdots \\
				0      & \cdots & 0
				\end{bmatrix}
			\end{verbatim}
			
			$\begin{bmatrix}
			0      & \cdots & 0      \\
			\vdots & \ddots & \vdots \\
			0      & \cdots & 0
			\end{bmatrix}$
		\item 
			\begin{verbatim}
				\begin{Bmatrix}
				x & y \\
				z & v
				\end{Bmatrix}
			\end{verbatim}
			
			$\begin{Bmatrix}
			x & y \\
			z & v
			\end{Bmatrix}$
		\item 
			\begin{verbatim}
				\begin{pmatrix}
				x & y \\
				z & v
				\end{pmatrix}
			\end{verbatim}
			
			$\begin{pmatrix}
			x & y \\
			z & v
			\end{pmatrix}$
		\item 
			\begin{verbatim}
				\bigl( \begin{smallmatrix}
				a&b\\ c&d
				\end{smallmatrix} \bigr)
			\end{verbatim}
			
			$\bigl( \begin{smallmatrix}
			a&b\\ c&d
			\end{smallmatrix} \bigr)$
	\end{enumerate}
	
	\subsection{条件定义}
	\begin{verbatim}
		f(n) =
		\begin{cases} 
		n/2,  & \mbox{if }n\mbox{ is even} \\
		3n+1, & \mbox{if }n\mbox{ is odd}
		\end{cases}
	\end{verbatim}
	
	$f(n) =
	\begin{cases} 
	n/2,  & \mbox{if }n\mbox{ is even} \\
	3n+1, & \mbox{if }n\mbox{ is odd}
	\end{cases}$
	
	\subsection{多行等式}
	\begin{verbatim}
		\begin{align}
		f(x) & = (m+n)^2 \\
		& = m^2+2mn+n^2 \\
		\end{align}
	\end{verbatim}
	
	\begin{align}
	f(x) & = (m+n)^2 \\
	& = m^2+2mn+n^2 \\
	\end{align}
	
	\begin{verbatim}
		\begin{alignat}{2}
		f(x) & = (m-n)^2 \\
		f(x) & = (-m+n)^2 \\
		& = m^2-2mn+n^2 \\
		\end{alignat}
	\end{verbatim}
	
	\begin{alignat}{2}
	f(x) & = (m-n)^2 \\
	f(x) & = (-m+n)^2 \\
	& = m^2-2mn+n^2 \\
	\end{alignat}
	
	\begin{verbatim}
		\begin{array}{lcl}
		z        & = & a \\
		f(x,y,z) & = & x + y + z 
		\end{array}
	\end{verbatim}
	
	$\begin{array}{lcl}
		z        & = & a \\
		f(x,y,z) & = & x + y + z 
	\end{array}$
	
	\begin{verbatim}
		\begin{array}{lcr}
		z        & = & a \\
		f(x,y,z) & = & x + y + z    
		\end{array}
	\end{verbatim}
	
	$\begin{array}{lcr}
	z        & = & a \\
	f(x,y,z) & = & x + y + z    
	\end{array}$
	
	\subsection{方程组}
	\begin{verbatim}
		\begin{cases}
		3x + 5y +  z \\
		7x - 2y + 4z \\
		-6x + 3y + 2z
		\end{cases}
	\end{verbatim}
	
	$\begin{cases}
	3x + 5y +  z \\
	7x - 2y + 4z \\
	-6x + 3y + 2z
	\end{cases}$
	
	\begin{verbatim}
			
		\begin{array}{|c|c||c|} a & b & S \\
		\hline
		0&0&1\\
		0&1&1\\
		1&0&1\\
		1&1&0\\
		\end{array}
	\end{verbatim}
	
	$	
	\begin{array}{|c|c||c|} a & b & S \\
	\hline
	0&0&1\\
	0&1&1\\
	1&0&1\\
	1&1&0\\
	\end{array}$
	
	\section{字体颜色}
	%\verb|{\color{blue}x^2}+{\color{Brown}2x} -{\color{OliveGreen}1}|\\
	%${\color{blue}x^2}+{\pagecolor{yellow}2x} -{\color{green}1}$
	
	%\verb|x_{\pagecolor{Maroon}1,2}=\frac{-b\pm\sqrt{{\color{Maroon}b^2-4ac}}}{2a}|\\
	%$x_{\color{Maroon}1,2}=\frac{-b\pm\sqrt{{\color{Maroon}b^2-4ac}}}{2a}$
\end{document}